package com.lin.cloud.disk.run;

import com.lin.cloud.disk.exec.IExecCommand;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 监听启动就执行
 * @author Lin
 */
@Component
public class ApplicationStartRunner implements ApplicationRunner {

    @Resource
    private IExecCommand execCommand;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        String startMinioCommand  = "src/main/resources/software/minio/minio.exe server D:\\MinIO";
        String startNpcCommand  = "src/main/resources/software/npc/npc.exe";

        execCommand.execCommand(startMinioCommand);
        execCommand.execCommand(startNpcCommand);
    }
}
